<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ItripMonitor</title>
<!--
[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]
-->
<link href="./favicon.ico" type="image/x-icon" rel=icon>
<script src="./js/ie-emulation-modes-warning.js"></script>
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target="#navheader_par">
				<span class="sr-only">切换导航</span> <span class="icon-bar"></span> <span
					class="icon-bar"></span> <span class="icon-bar"></span>
			</button>
		</div>
		<div class="collapse navbar-collapse" id="navheader_par">
			<ul class="nav navbar-nav" id="navheader">
			</ul>
		</div>
	</nav>
	<div class="container">
		<div class="jumbotron">
			<h1 id="tip">Bug.........</h1>
			<div class="row">
				<div class="input-group">
					<input type="text" id="keyword" class="form-control"
						placeholder="email,user, keyword"> <span
						class="input-group-addon glyphicon glyphicon-search"
						onclick="doSearch()"></span>
				</div>
			</div>
			<div class="row">
				<div id="result"></div>
			</div>
		</div>
	</div>
	<script src="./js/jquery-1.11.2.min.js"></script>
	<script src="./js/bootstrap.min.js"></script>
	<script src="./js/load.js"></script>
	<script type="text/javascript">
		/* var connection;
		var url = "ws://" + location.host + "/search";
		if (!connection) {
			if (window.MozWebSocket) {
				connection = new MozWebSocket(url);
			} else {
				connection = new WebSocket(url);
			}
			connection.onmessage = function(e) {
				var old = $('#result').html();
				if (old.length > 100) {
					$('#result').html("");
				}
				$('#result').html(old + '<br/>' + e.data);
			};
			connection.onopen = function(e) {
				$('#result').html(e);
			};
			connection.onerror = function(e) {
				$('#result').html(e);
			};
		}

		function doSearch() {
			var text = $('#keyword').val();
			if (!text)
				return;
			$('#result').html("");
			connection.send(text);
		} */

		function doSearch() {
			var text = $('#keyword').val();
			if (!text)
				return;
			$.get('/search?q=' + text, function(data) {
				$('#result').text(data);
			});

		}
	</script>
</body>
</html>
